package com.ptit.giaothong.bienbao;

import android.app.Activity;
import android.app.Dialog;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.ptit.giaothong.R;

public class Bienbaodetail {
	private Activity activity;
	private TextView txtdesc, txttitle;
	private ImageView imageView;

	public Bienbaodetail(Activity activity) {
		this.activity = activity;

	}

	public void Init(Itembb item) {
		final Dialog dialog = new Dialog(activity);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.getWindow().setBackgroundDrawableResource(
				android.R.color.transparent);
		dialog.setCanceledOnTouchOutside(true);
		dialog.setContentView(R.layout.detailbienbao);
		dialog.show();

		imageView = (ImageView) dialog.findViewById(R.id.imageView_detailt);

		txtdesc = (TextView) dialog.findViewById(R.id.txtdesc_id);
		txttitle = (TextView) dialog.findViewById(R.id.txttitle);

		imageView.setImageResource(activity.getResources().getIdentifier(
				item.getIcon(), "drawable", activity.getPackageName()));
		txttitle.setText(item.getName());
		txtdesc.setText(item.getDesc());

	}
}
